package com.scpii.universal.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.DataInterfaceUpdateTab;
import com.scpii.universal.hibernate.intface.BaseInterface;
import com.scpii.universal.util.SpringBeanFactory;

public class DataInterfaceUpdateTabService implements
		BaseInterface<DataInterfaceUpdateTab> {
	private static final Logger log = LoggerFactory
			.getLogger(DataInterfaceUpdateTabService.class);
//	private BaseDao<DataInterfaceUpdateTab> dataInterfaceUpdateTabDao = SpringBeanFactory.dataInterfaceUpdateTabDao;
	private BaseDao<DataInterfaceUpdateTab> dataInterfaceUpdateTabDao;
	
	public DataInterfaceUpdateTab get(Integer id) throws Exception {
		return dataInterfaceUpdateTabDao.get(id);
	}

	public List<DataInterfaceUpdateTab> getAll() throws Exception {
		return dataInterfaceUpdateTabDao.getAll();
	}

	public DataInterfaceUpdateTab get(String propertyName, Object value) throws Exception {
		return null;
	}

	public List<DataInterfaceUpdateTab> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public Long getTotalCount() throws Exception {
		return null;
	}

	public void save(DataInterfaceUpdateTab obj) throws Exception {

	}

	public void update(DataInterfaceUpdateTab obj) throws Exception {

	}

	public void delete(DataInterfaceUpdateTab obj) throws Exception {

	}

	public void delete(Integer id) throws Exception {

	}

	public List<DataInterfaceUpdateTab> hqlGetList(String hql, Map<String, Object> argsMap)
			throws Exception {
		return dataInterfaceUpdateTabDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		dataInterfaceUpdateTabDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return dataInterfaceUpdateTabDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<DataInterfaceUpdateTab> sqlGetList(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return dataInterfaceUpdateTabDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		dataInterfaceUpdateTabDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return dataInterfaceUpdateTabDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 根据应用ID，获得需要更新的接口列表
	 * @param appId
	 * @return
	 * @throws Exception
	 * @author 甘建新
	 * 2012-7-19下午10:07:46
	 */
	public List<DataInterfaceUpdateTab> getUpdateInterfaceList(int appId)throws Exception{
		if (appId>0) {
			Map<String, Object> argsMap = new HashMap<String, Object>();
			argsMap.put("appId", appId);
			return this.hqlGetList("GET_UPDATE_INTERFACES", argsMap);
		}
		return null;
	}

	//Setter
	public void setDataInterfaceUpdateTabDao(
			BaseDao<DataInterfaceUpdateTab> dataInterfaceUpdateTabDao) {
		this.dataInterfaceUpdateTabDao = dataInterfaceUpdateTabDao;
	}
	
	
}